package com.jiexinyun.constants;

import io.jsonwebtoken.Claims;

public class ConstantsC {

    public static final String MAIN_BODY = "COMMON";

    public static final String REDIS_KEY_TOKEN_PREFIX = "jiexinyun_";

    /**
     * 通用成功标识
     */
    public static final String SUCCESS = "0";

    /**
     * 通用失败标识
     */
    public static final String FAIL = "1";

    //通用状态
    public static final Short COMMON_STATUS_INUSE = Short.valueOf("1");//启用
    public static final Short COMMON_STATUS_NOUSE = Short.valueOf("2");//禁用


    //用户状态区分 1 启用 2 禁用
    public static final Short USER_STATUS_INUSE = Short.valueOf("1");
    public static final Short USER_STATUS_NOUSE = Short.valueOf("2");

    //角色状态区分 1 启用 2 禁用
    public static final Short ROLE_STATUS_INUSE = Short.valueOf("1");
    public static final Short ROLE_STATUS_NOUSE = Short.valueOf("2");

    //权限状态区分 1 启用 2 禁用
    public static final Short PERM_STATUS_INUSE = Short.valueOf("1");
    public static final Short PERM_STATUS_NOUSE = Short.valueOf("2");

    //权限类型区分
    public static final Short PERM_TYPE_MOD = Short.valueOf("1");//目录
    public static final Short PERM_TYPE_MENU = Short.valueOf("2");//菜单
    public static final Short PERM_TYPE_BTN = Short.valueOf("3");//按钮

    //不存在的ID
    public static final String NON_ID = "-1";

    //最高ID
    public static final String PARENT_ID = "0";

    //最高权限ID
    public static final String HIGHIST_PERM_PARENT_ID = "0";

    //用户默认密码
    public static final String USER_INIT_PASSWORD = "123456";

    //管理员用户名 jiexinyun和供应商都用这个
    public static final String ADMIN_USERNAME = "admin";

    //请求头键值(保存token)
    public static final String HEADER_AUTHORIZATION = "AUTHORIZATION";

    //报修状态
    public static final Short REPORT_REPAIR_STATUS_UNDO = Short.valueOf("1");//1 待处理
    public static final Short REPORT_REPAIR_STATUS_COMMITTED = Short.valueOf("2");//2 已上报维修，进入维修环节
    public static final Short REPORT_REPAIR_STATUS_FINISH = Short.valueOf("3");//3 已结束

    //维修状态
    public static final Short REPAIR_STATUS_UNDO = Short.valueOf("1");//1 待维修
    public static final Short REPAIR_STATUS_DO = Short.valueOf("2");//2 维修中
    public static final Short REPAIR_STATUS_COMMITTED = Short.valueOf("3");//3 维修员上报维修完成
    public static final Short REPAIR_STATUS_CONFIRMED = Short.valueOf("4");//4 生产班/组长确认维修完成

    //维修类型
    public static final Short REPAIR_TYPE_ONE = Short.valueOf("1");//1 标准维修
    public static final Short REPAIR_TYPE_TWO = Short.valueOf("2");//2 计划维修
    public static final Short REPAIR_TYPE_THREE = Short.valueOf("3");//3 紧急维修
    public static final Short REPAIR_TYPE_FOUR = Short.valueOf("4");//4 委外维修

    //停机/带病工作
    //设备状态 deviceStatus 整数
    public static final Short DEVICE_STATUS_OUTAGE = Short.valueOf("1");//1 停机
    public static final Short DEVICE_STATUS_SICK_WORKING  = Short.valueOf("2");//2 带病工作

    //故障类别 faultType 整数
    public static final Short FAULT_TYPE_ONE = Short.valueOf("1");//1 工艺工程
    public static final Short FAULT_TYPE_TWO  = Short.valueOf("2");//2 安全保护
    public static final Short FAULT_TYPE_THREE  = Short.valueOf("3");//3 品质异常
    public static final Short FAULT_TYPE_FOUR  = Short.valueOf("4");//4 物料短缺
    public static final Short FAULT_TYPE_OTHER  = Short.valueOf("5");//5 其它类别

    //部门状态 1 启用 2 禁用
    public static final Short DEPT_STATUS_INUSE = Short.valueOf("1");//1 启用
    public static final Short DEPT_STATUS_NOUSE = Short.valueOf("2");//2 禁用

    //出入库 1 出库 2 入库
    public static final Short ACCESSORY_STORAGE_OUT = Short.valueOf("1");//1 出库
    public static final Short ACCESSORY_STORAGE_IN = Short.valueOf("2");//2 入库

    //签到状态
    public static final Short SIGN_RECORDS_STATUS_SIGNIN = Short.valueOf("1");//1 签到
    public static final Short SIGN_RECORDS_STATUS_SIGNOUT = Short.valueOf("2");//2 签出

    //代码表是否有子级
    public static final boolean CODE_TABLE_WITH_CHILD = true;// 有子级
    public static final boolean CODE_TABLE_NO_CHILD = false;// 没有子级

    //是否采集
    public static final String DATA_COLLECT = String.valueOf("1");//1 采集
    public static final String DATA_NO_COLLECT = String.valueOf("2");;//2 不采集

    /**
     * UTF-8 字符集
     */
    public static final String UTF8 = "UTF-8";

    /**
     * GBK 字符集
     */
    public static final String GBK = "GBK";

    /**
     * http请求
     */
    public static final String HTTP = "http://";

    /**
     * https请求
     */
    public static final String HTTPS = "https://";

    /**
     * 登录成功
     */
    public static final String LOGIN_SUCCESS = "Success";

    /**
     * 注销
     */
    public static final String LOGOUT = "Logout";

    /**
     * 注册
     */
    public static final String REGISTER = "Register";

    /**
     * 登录失败
     */
    public static final String LOGIN_FAIL = "Error";

    /**
     * 所有权限标识
     */
    public static final String ALL_PERMISSION = "*:*:*";

    /**
     * 管理员角色权限标识
     */
    public static final String SUPER_ADMIN = "admin";

    /**
     * 角色权限分隔符
     */
    public static final String ROLE_DELIMETER = ",";

    /**
     * 权限标识分隔符
     */
    public static final String PERMISSION_DELIMETER = ",";

    /**
     * 验证码有效期（分钟）
     */
    public static final Integer CAPTCHA_EXPIRATION = 2;

    /**
     * 令牌
     */
    public static final String TOKEN = "token";

    /**
     * 令牌前缀
     */
    public static final String TOKEN_PREFIX = "Bearer ";

    /**
     * 令牌前缀
     */
    public static final String LOGIN_USER_KEY = "login_user_key";

    /**
     * 用户ID
     */
    public static final String JWT_USERID = "userid";

    /**
     * 用户名称
     */
    public static final String JWT_USERNAME = Claims.SUBJECT;

    /**
     * 用户头像
     */
    public static final String JWT_AVATAR = "avatar";

    /**
     * 创建时间
     */
    public static final String JWT_CREATED = "created";

    /**
     * 用户权限
     */
    public static final String JWT_AUTHORITIES = "authorities";

    /**
     * 资源映射路径 前缀
     */
    public static final String RESOURCE_PREFIX = "/profile";

    /**
     * RMI 远程方法调用
     */
    public static final String LOOKUP_RMI = "rmi:";

    /**
     * LDAP 远程方法调用
     */
    public static final String LOOKUP_LDAP = "ldap:";

    /**
     * LDAPS 远程方法调用
     */
    public static final String LOOKUP_LDAPS = "ldaps:";

    /**
     * 自动识别json对象白名单配置（仅允许解析的包名，范围越小越安全）
     */
    public static final String[] JSON_WHITELIST_STR = { "org.springframework", "com.jiexinyun" };

    /**
     * 定时任务白名单配置（仅允许访问的包名，如其他需要可以自行添加）
     */
    public static final String[] JOB_WHITELIST_STR = { "com.ruoyi.framework.task" };

    /**
     * 定时任务违规的字符
     */
    public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml",
            "org.springframework", "org.apache", "com.ruoyi.common.utils.file", "com.ruoyi.framework.config", "com.ruoyi.project.tool" };


    /**
     * 以下是各个编号前缀
     */
    public static final String DEVICE_NO_PREFIX = "DEVICE";
    public static final String DEVICE_MANIFEST_NO_PREFIX = "DEVICE-MANIFEST";
    public static final String WAREHOUSE_LOCATION_NO_PREFIX = "WAREHOUSE-LOCATION";

    /**
     * 以下是各个单号前缀
     */
    //报修单号
    public static final String REPORT_REPAIR_NO_PREFIX = "REPORT-REPAIR";

    //维修单号前缀
    public static final String REPAIR_NO_PREFIX = "REPAIR";

    //代码表根编码
    //位置管理
    public static final String CODE_TABLE_ROOT_CODE_0001 = "0001";

    //库房库位管理
    public static final String CODE_TABLE_ROOT_CODE_0002 = "0002";

    //部门管理
    public static final String CODE_TABLE_ROOT_CODE_0003 = "0003";

    //设备类别
    public static final String CODE_TABLE_ROOT_CODE_0004 = "0004";

    //供应商管理
    public static final String CODE_TABLE_ROOT_CODE_0005 = "0005";

    //配件类别
    public static final String CODE_TABLE_ROOT_CODE_0006 = "0006";

    //配件品牌
    public static final String CODE_TABLE_ROOT_CODE_0007 = "0007";

    //配件品牌
    public static final String CODE_TABLE_ROOT_CODE_0008 = "0008";

    //配件品牌
    public static final String CODE_TABLE_ROOT_CODE_0009 = "0009";






    //出入库编号前缀
    public static final String STORE_NO_PREFIX = "STORE-";

    //出入库批次号前缀
    public static final String STORE_BATCH_NO_PREFIX = "STORE-BATCH-";

    //任务job状态
    public static final String JOB_STATUS_INUSE = "0";//启用
    public static final String JOB_STATUS_NOUSE = "1";//禁用

    //发布状态
    public static final Short DEPLOY_STATUS_INUSE = Short.valueOf("1");//已经发布
    public static final Short DEPLOY_STATUS_NOUSE = Short.valueOf("2");//未发布

}